//
//  VideoTableViewCell.m
//  LuCoding
//
//  Created by lanou3g on 15/10/14.
//  Copyright © 2015年 自由科技. All rights reserved.
//

#import "VideoTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "VideoModle.h"

@implementation VideoTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addSubView];
    }
    return self;
}

- (void)addSubView{
    self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 100, 80)];
    _imgView.backgroundColor = [UIColor redColor];
    [self addSubview:_imgView];

    self.videoTitle = [[UILabel alloc] initWithFrame:CGRectMake(130, 10, 200, 20)];
    _videoTitle.backgroundColor = [UIColor whiteColor];
    [self addSubview:_videoTitle];

    self.contentLable = [[UILabel alloc] initWithFrame:CGRectMake(130, 40, 180, 20)];
    _contentLable.backgroundColor = [UIColor whiteColor];
    _contentLable.font = [UIFont systemFontOfSize:13];
    [self addSubview:_contentLable];

    self.readNumber = [[UILabel alloc] initWithFrame:CGRectMake(270, 80, 110, 20)];
    _readNumber.backgroundColor = [UIColor whiteColor];
    [self addSubview:_readNumber];

}

- (void)setVideo:(VideoModle *)video{
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:video.photo]];
    self.videoTitle.text = video.title;
    self.readNumber.text = [NSString stringWithFormat:@"%@ 阅读",video.readCount];
    self.contentLable.text = video.content;
    
}




@end
